$(document).ready(function() {
	
	//制定生产计划
	$("#createProductionPlanButton").on("click", function() {
		$("#contentIframe", parent.document.body).attr("src",
				JSP_PRE_URL+"editProductionPlan");
	});
	
	//审核生产计划
	$("#exameProductionPlanButton").on("click", function() {
		$("#contentIframe", parent.document.body).attr("src",
				JSP_PRE_URL+"exameProductionPlan");
	});
	//查看生产计划
	$("#lookProductionPlanButton").on("click", function() {
		$("#contentIframe", parent.document.body).attr("src",
				JSP_PRE_URL+"showAllProductionPlan");
	});
	
	
	function showMakeProductionPlanBox(){
		var createProductionPlanBox = layer.open({
			type : 2,
			maxmin : true,
			title : '制定生产计划',
			offset : '4%',
			area : [ '85%', '92%' ],
			btn : [ '确认', '取消' ] // 只是为了演示
			,
			yes : function() {
				// 获得子窗口的值
				var childBox = layer.getChildFrame('body', createProductionPlanBox);
				var inputFoodName = childBox.find("#inputFoodName").val();
				var inputClassificationId = childBox.find("#inputClassificationId")
						.val();
				var inputUnitId = childBox.find("#inputUnitId").val();
				var inputProductPrice = childBox.find("#inputProductPrice").val();
				var inputSellPrice = childBox.find("#inputSellPrice").val();
				
				var foodMaterialList = childBox.find("#materialList").val();
				
				createNewFood(inputFoodName, inputClassificationId, inputUnitId,
						inputProductPrice, inputSellPrice,foodMaterialList);
			},
			btn2 : function() {
				layer.close();
			},
			shadeClose : true, // 点击遮罩关闭
			content : JSP_PRE_URL+'editProductionPlan'
		});
		
		
	}
	
});


